import { computed, Ref } from "vue";
import { createNamespacedHelpers, mapGetters } from "vuex";
import { useStore } from "../store";
import { useMapper } from "./useMapper";

const useGetters = (type: string, arry: string[]) => {
  const store = useStore();
  let mapFun = mapGetters;
  if (type) {
    mapFun = createNamespacedHelpers(type).mapGetters;
  }
  const getterState = useMapper(mapFun, arry);

  return getterState;
};

export { useGetters };
